<?php
MYTCONN();
if (isset($_GET['TP'])) {
    $OB_Id = $_GET['ID'];
    $Dnc_TYPE = $_GET['TP'];
} elseif (isset($_POST['dnc_TipoDoc'])) {
    $Dnc_TYPE = $_POST['dnc_TipoDoc'];
    $OB_Id = $_POST['AML_ID'];
} else {
    $Dnc_TYPE = 0;
    $OB_Id = $_GET['ID'];
}
echo '<form accept-charset="utf-8" action="" method="post" name="UPDNL" enctype="multipart/form-data">';
mn_field('hidden', 'ED', 'AML_ID', $OB_Id, '', '', '', '');
?>
<div class="title"><img src="bin.php?get=import.png">
    * Documento de Identificação, NIF e Comprovativos de Morada devem ser anexados apenas na ficha de cliente.
</div>
<?php
mn_field('select', 'ED', 'dnc_TipoDoc', $Dnc_TYPE, "SELECT dnc_ID AS ID, dnc_Doc AS NAME
		FROM hd_doctipos
			LEFT OUTER JOIN hd_amllocks ON dnc_Nivel = REF
			WHERE dnc_Activo = 1 AND dnc_Country = {$__sys['Country']} AND (REPORT is null OR REPORT=1)",
                                '', '', 'inputbox" onchange="
	  document.UPDNL.action=\'_response/call.php?get=Compliance/frmAmlDoc\';
	  subform(\'UPDNL\',\'DNL_Form\');');
if ($Dnc_TYPE > 0) {
    $AMLDOCS = "SELECT tdc_Id AS ID, tdc_Tipo AS NAME FROM hd_documentostipos WHERE tdc_dnc = {$Dnc_TYPE}";
    mn_field('select', 'ED', 'dnl_dncTipo', '', $AMLDOCS, '', '', 'inputbox');
}

mn_field('file', 'ED', 'FILE', '', '20', '20', '', 'inputbox');
mn_field('textarea', 'ED', 'File_Observ', '', '38', '4', 'False', 'inputbox');
mn_field('submit', 'ED', 'Upload', 'Salvar', '', '', 'False', 'inputbox" onclick="
	  document.UPDNL.action=\'call.php?get=Compliance/prc_amladddocument\';
	  subform(\'UPDNL\',\'DNL_Action\');'); ?>
</form>